<template>
  <view class="">
    <uni-data-picker
      placeholder="请选择班级"
      popup-title="请选择所在地区"
      :map="{ text: 'label', value: 'value' }"
      :localdata="areaData"
      ref="pickArea"
      @change="pickArea"
    >
      <slot />
    </uni-data-picker>
  </view>
</template>

<script>
import areaData from '@/components/w-picker/areadata/areadata.js';
export default {
  props: {
    value: {
      type: String,
      default: ''
    },
  },

  data() {
    return {
      areaData,
    };
  },

  methods: {
    pickArea(e) {
      const varr = e.detail.value;
			const v = varr.map(o => o.text).join('')
      this.$emit('update:value', v);
    },

    show() {
      this.$refs.pickArea.show();
    }
  },
};
</script>
